# @Time    :2025/3/25 16:57
"""
10）给定两个集合 set1 = {1, 2, 3, 4, 5} 和 set2 = {4, 5, 6, 7, 8}，
编写一个程序，找出两个集合的交集、并集以及差集
"""
"""
set1 & set2	两集合求交集
set1 | set2	两集合求并集

"""
set1 = {1, 2, 3, 4, 5}
set2 = {4, 5, 6, 7, 8}
set3 = set2 & set1  # 交集 求共同部分
set4 = set2 | set1
print("差集:", set2 - set1)
print("差集:", set1 - set2)
print("交集", set3)
print("并集:", set4)
